<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // let fun1 = (a,b,c,d,...arr) => {
        //     console.log(a,b,c,d)
        //     console.log(arr)
        // }

        // fun1(1,2,3,4,5,6,7,8,9,10)
        
        // let arr = [1,2,3]
        // let fun1 = (a,b,c) => {
        //     console.log(a,b,c)
        // }
        // fun1(...arr)

        // 应用场景 1 合并数组
        let arr = [1,2,3]
        let arr1 = [4,5,6]
        let arr2 = [...arr, ...arr1]
        console.log(arr2)

        // 应用场景 2 合并对象属性
        let p1 = {name:'张三'}
        let p2 ={age:10}
        let p3 ={gender:'boy'}
        let person ={...p1,...p2,...p3}
        console.log(person)
        
    </script>
</head>
<body>
    
</body>
</html>